package com.vitabuybuy.tv.ui.mine.follow.adapter

import androidx.recyclerview.widget.RecyclerView
import com.vitabuybuy.tv.R
import com.vitabuybuy.tv.databinding.ItemFollowBinding
import com.vitabuybuy.tv.dto.MyFollowListDto
import com.library.common.base.BindRecycAdapter

class MyFollowAdapter : BindRecycAdapter<ItemFollowBinding, MyFollowListDto>() {
    var type = 1
    override fun onBindViewHolder(
        mBinding: ItemFollowBinding,
        itemData: MyFollowListDto,
        holder: RecyclerView.ViewHolder,
        position: Int
    ) {
        mBinding.itemBean = itemData
        mBinding.type = type
        mBinding.rlRoot.setOnClickListener {
            onItemClickListener.invoke(position)
        }
        mBinding.btnDelete.setOnClickListener {
            onDeleteClickListener.invoke(position)
        }
    }

    override fun normalViewId(viewType: Int): Int {
        return R.layout.item_follow
    }

    lateinit var onItemClickListener: (position: Int) -> Unit
    lateinit var onDeleteClickListener: (position: Int) -> Unit

}
